import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom'
import Hot from './components/Hot';
import New from './components/New';
import Collect from './components/Collect';
import Trends from './components/Trends';
import Footer from './components/Footer';
import Search from './components/Search';
import './base.scss'
import './main.scss'

ReactDOM.render(
  <Router>
    <Route exact path="/">
      <Redirect to="/new" />
    </Route>
    <Switch>
      <Route path='/search'>
        <Search />
      </Route>
      <Route path='/hot'>
        <Hot />
      </Route>
      <Route path='/new'>
        <New />
      </Route>
      <Route path='/collect'>
        <Collect />
      </Route>
      <Route path='/trends'>
        <Trends />
      </Route>
    </Switch>
    <Footer />
  </Router>,
  document.getElementById('root')
);